const fs=require("fs");
//导入lodash中的times方法，并赋给times常量
const {times}=require("lodash");
const{faker}=require("@faker-js/faker");


let users=[];
times(10,index=>{
    users.push({
        id:index+1,
        uuid:faker.datatype.uuid,
        username:`user${faker.datatype.number({min:100,max:900})}`,
        password:faker.internet.password(),
        nickname:faker.lorem.word()

    })
})
let db={users};
let dbJson=JSON.stringify(db,null,4);
fs.writeFileSync("db.json",dbJson);